import requests


def get_url(url):
    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) "
                      "Chrome/84.0.4147.105 Safari/537.36 Edg/84.0.522.52"}
    res = requests.get(url, headers = headers)
    return res


def main():
    url = input("请输入链接地址：")
    res = get_url(url)
    with open("res.txt", "w", encoding="utf-8") as file:
        file.write(res.text)


if __name__ == "__main__":
    main()